Homebrew 101

It is assumed you already can run DS code with an EZ4 (i.e. you have a passme(2), nopass of some form or modded firmware).

First things first
EZ4 homebrew likes to be in the .ds.gba format, that is to say a GBA header added. There are a multitude of ways to do this:
Simple way
dsbuild is bundled, use it to patch the file (drag and drop), it is part of devkitpro but grabbing a 20 meg kit for a tiny 8kb file it not reallt worth it.
Other way
Download ndsmall.bin from http://darkfader.net/ds/ (many other sites have it as well)
Open a dos prompt and type or paste the following changing names:

copy /b ndsmall.bin+homebrew.nds newhomebrew.ds.gba


Bear in mind .sc.nds is the same thing just with a different extension.

SRAM: EZ4 Specific. Various homebrew uses the SRAM to save data (not so much now DLDI (explained below) appeared), typically they do not have the EZ4 "SRAM bits" added to the header. Read this thread (second page especially):
http://ezflash.sosuke.com/viewtopic.php?t=2801&start=0

DLDI:
Anyone who was into homebrew as recently as November 2006 would have had the fun of having to build their homebrew (assuming source was available and knowledge was had) to get card access. Mimicking moonshells end user patching Libfat (the de facto library for all this) added DLDI (dynamically linked device interface) to allow end users to patch their own homebrew for their cart (taking a huge burden from both coders and end users).

The EZ4 now has a single patch that should work with all homebrew and it is included in this zip):
There is a DS code patcher ( http://palib.info/forum/modules/newbb/viewtopic.php?topic_id=3508 ) and a copy of the command line DLDItool (syntax: dlditool ezsd.dldi homebrewname.nds)

Read either this for more:
http://ezflash.sosuke.com/wiki/index.php?title=DLDI
or this:
http://ezflash.sosuke.com/viewtopic.php?t=3466
or even the original page.
The second link is more for slower carts.

You can add a header and then DLDI patch or DLDI patch and add a header, should the homebrew be DLDI patched already then that is OK.